<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Experimental/Independent Film Community</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="description" content="An Independent Film Community" />
<meta name="copyright" content="Cmpe451-ProjectGroup#8" />
<link href="./jsp/user/style/expind-std.css" rel="stylesheet"
	type="text/css" />
<link href="./jsp/user/style/expind.css" rel="stylesheet"
	type="text/css" />
<script language="javascript"
	src="./jsp/user/scripts/jquery-1.8.2.min.js"></script>
<script language="javascript" src="./jsp/user/scripts/expind.js"></script>
</head>
<body>
	<div class="container_24">
		<jsp:include page="header.jsp" />

		<div class="grid_24">
			<form action="edit-movie" method="post" name="editMovie"
				enctype="multipart/form-data">
				<input type="hidden" id="movie-id" name="movie-id" value="${movie.mid }" />
				<c:if test="${movie.user.uid== sessionScope.user.uid }">
					<select id="project-options">
						<option value="1">Display Project</option>
						<option value="2" selected="selected">Edit Project</option>
					</select>
					<div class="grid_24 hr-line2"></div>

					<div class="grid_24 hr-line2"></div>
					<c:choose>
						<c:when test="${ empty updateError }">

						</c:when>
						<c:otherwise>
							<div style="color: red;">
								<c:out value="${updateError}"></c:out>
							</div>
							<br />
						</c:otherwise>
					</c:choose>

				</c:if>

				<table width="750px">
					<tr>
						<td>
							<table>
								<tr>
									<td style="padding: 5px"><input type="hidden"
										name="unique" value="${requestScope.movie.mid}" /> <img
										src=<c:out value="${ requestScope.movie.poster}"/>
										title=<c:out value="${ requestScope.movie.name }"/>
										width="180px" /> <input type="file" name="image" size="40" />&nbsp;or&nbsp;
										<input type="text" name="imageURL" /> <input type="hidden"
										name="currurl" /> <input type="hidden" name="type"
										value="user" /></td>
									<td>
										<table
											style="color: black; font-size: 15px; font-family: courier new"
											width="800px">
											<tr>
												<td>Complete</td>
												<td><input type="checkbox" name="completed"
													/>*</td>
											</tr>
											<tr>
												<td>Project Name</td>
												<td><input type="text" name="projectname"
													value="${movie.name }" />*</td>
											</tr>
											<tr>
												<td>Description</td>
												<td><textarea rows="4" cols="50" name="description">${movie.summary }</textarea>*
												</td>
											</tr>
											<tr>
												<td>Genre</td>
												<td><input type="text" name="genre"
													value="${movie.genre}" />*</td>
											</tr>

											<tr>
												<td>Poster</td>
												<td><input type="file" name="image" size="40" />
													&nbsp;or&nbsp; <input type="text" name="imageURL" /></td>
											</tr>
											<tr>
												<td><select id="titles">
														<c:forEach var="title" items="${titles}">
															<c:if test="${title.titleName ne 'director'}">
																<option value="${title.titleName}">${title.titleShowName}</option>
															</c:if>
														</c:forEach>
												</select></td>
												<td><input type="button" id="addtitle"
													value="Add Title" /></td>
											</tr>
										</table>
										<div id="wanted">
											<c:set var="actorJobCount" value="0" scope="request" />
											<c:set var="crewJobCount" value="0" scope="request" />
											<c:forEach var="actorjob" items="${actorjobs}">
												<c:set var="actorJobCount" value="${actorJobCount+1}"
													scope="request" />
												<c:set var="actorjob" value="${actorjob}" scope="request" />
												<jsp:include page="project-actor-properties.jsp"></jsp:include>
											</c:forEach>

											<c:forEach var="crewjob" items="${crewjobs}">
												<c:set var="crewJobCount" value="${crewJobCount+1}"
													scope="request" />
												<c:set var="crewjob" value="${crewjob}" scope="request" />
												<jsp:include page="project-crew-properties.jsp"></jsp:include>
											</c:forEach>
											<input type="hidden" value="${actorJobCount }"
												name="numofactors"> <input type="hidden"
												value="${crewJobCount }" name="numofcrews">
										</div>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
				<div id="wanted"></div>
				<input type="submit" value="Submit" />
			</form>
		</div>
	</div>
</body>
</html>